export default function formatTime(val){
    let time = new Date(val)
    let Y = time.getFullYear()
    let M = time.getMonth() + 1
    let D = time.getDate()
    return `${Y}-${addZero(M)}-${addZero(D)}`
}

function addZero(val) {
    return val > 10 ? val : "0"+val 
}